package com.dmooo.yxmmerchant;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;

import com.common.util.SPUtils;
import com.dmooo.yxmmerchant.common.Config;
import com.dmooo.yxmmerchant.view.ui.LoginActivity;


public class SplashActivity extends Activity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                if("".equals(SPUtils.get(SplashActivity.this,Config.TOKEN,"").toString())){
                    Intent intent = new Intent(SplashActivity.this, LoginActivity.class);
                    startActivity(intent);
                }else{
                    Intent intent = new Intent(SplashActivity.this, MainActivity.class);
                    startActivity(intent);
                }

                finish();
            }
        },100);
    }
    @Override
    public void onBackPressed() {
        //super.onBackPressed();
    }
}
